package com.cedric.yixianpai.game.cards.Sects.swordCards.c_JinDan;

import com.cedric.yixianpai.game.Constants.CardType;
import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class Yun_RouXin extends SwordCard {
    int Yun_cure;
    /**
     * 云剑·柔心
     * 持续：每次使用云剑时加2/3/4生命
     */
    public Yun_RouXin(@Value("1") int lvl) {
        super("云剑·柔心");
        this.setLevel(lvl);
        this.setPeriod(Period.JINDAN);
        this.setDescription("持续：每次使用云剑时加2/3/4生命");
        this.setCardType(CardType.YUN);
        this.setSustained();

        if (1 == lvl) {
            this.Yun_cure = 2;
        } else if (2 == lvl) {
            this.Yun_cure = 3;
        } else if (3 == lvl) {
            this.Yun_cure = 4;
        } else {
            throw new RuntimeException("Card Type Error!");
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        Sta1.getPlayerBuff().addYun_Cure(this.Yun_cure);
        return true;
    }
}
